home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / 80x0992d.zip / CTRLC.TXT < prev    next >
Text File  |  1992-09-30  |  1KB  |  30 lines

  1. By: Matthew Hildebrand
  2. Re: Ctrl-C & Ctrl-Break trap
  3. --------------------------------------------------------------------
  4.  
  5. I've been noticing a lot of discussion regarding Ctrl-C and Ctrl-Break
  6. trapping, and the difficulties associated with it.  Here's some code I
  7. wrote to do this; it works quite well.  TASM syntax, of course:
  8.  
  9. Notes:
  10. 1. To trap other keys, add the trapping logic between @@L2 and
  11.    @@oldHandler.
  12. 2. This code uses int 16h, function 12h (Get enhanced keyboard flags). 
  13.    If you don't have an enhanced keyboard, I don't know what will
  14.    happen. I guess int 16h, function 02h would be in order. Of course,
  15.    you could just take a peek at 40:17, but I've let the BIOS do the 
  16.    job for compatability.
  17. 3. I've got a P386 at the top. There aren't any 386+ instructions, 
  18.    but I threw it in for alignment. In fact, I don't think there's even 
  19.    a 286 instruction in there. Who knows? If there is, it's nothing 
  20.    that's hard to change.
  21. 4. I've tried all sorts of ways to confuse this code, but it kept working.  
  22.    If anyone finds something wrong with it, please let me know.
  23.  
  24. Please direct any questions or comments to either 80XXX or 1:247/128,
  25. whichever is appropriate.
  26.  
  27. Hope it helps,
  28.  
  29.         Matt
  30.